var app = getApp();
Page({
    bindFormSubmit:function(e){
        console.log(1)
        var word=e.detail.value.word
        var phone=e.detail.value.phone
        var email=e.detail.value.email
        var content=e.detail.value.content
        // console.log(word,phone,email,content)
        // app.showToast()
        wx.request({
            method:'post',
            url: 'https://www.vaniswdq.com/saveSuggestion',
            data: {
                name:word,
                phone:phone,
                mail:email,
                content:content
            },
            header: {
                'content-type': 'application/x-www-form-urlencoded'
            },
            success: function(res) {
                
                if(res.data.status=="0"){
                    // console.log(res.data)
                     wx.showModal({
                      title: '提示',
                      content: "提交成功",
                      showCancel:false,
                      success: function(res) {
                        if (res.confirm) {
                            wx.redirectTo({
                                url: '/pages/mine/mine',
                            })
                        } 
                        }
                      })
                }else{
                     wx.showModal({
                      title: '提示',
                      content: res.data.msg,
                      showCancel:false
                      })
                }
            }
        })
    },
    onShareAppMessage: function () {
        var brandId=wx.getStorageSync('brandId')
        return {
        title: '到此一玩小程序',
        path: '/pages/home/home?brandId='+brandId,
        success: function(res) {
            // 分享成功
        },
        fail: function(res) {
            // 分享失败
        }
        }
    }
})